#include <QtGui/QApplication>
#include "MikinolQSensorManagerWidget.h"
#include "MikinolSensorManager.h"

#include "MikinolQFaceTrackerTestWidget.h"
#include <windows.h>

//int main(int argc, char *argv[])
int WINAPI WinMain(      
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
)
{		
	int argc = 0;
	char** argv = NULL;
	QApplication* l_App = new QApplication( argc, argv );

	Mikinol::SensorManager* sensorManager = new Mikinol::SensorManager();

	
	//QWidget* mainWidget = new QWidget();
	QWidget* mainWidget = NULL;
	Mikinol::QSensorManagerWidget* sensorManagerWidget = new Mikinol::QSensorManagerWidget(mainWidget, sensorManager);
	Mikinol::QFaceTrackerTestWidget* faceTrackerWidget = new Mikinol::QFaceTrackerTestWidget(mainWidget, sensorManager);
	Mikinol::QFaceTrackerTestWidget* faceTrackerWidget2 = new Mikinol::QFaceTrackerTestWidget(mainWidget, sensorManager);
	
//	mainWidget->show();
//	mainWidget->resize(100, 100);
	sensorManagerWidget->resize(320, 480);
	sensorManagerWidget->show();
	faceTrackerWidget->resize(320, 400);
	faceTrackerWidget->show();
	faceTrackerWidget2->resize(320, 400);
	faceTrackerWidget2->show();
	
	int ret = l_App->exec();

	delete mainWidget;
	mainWidget = NULL;

	delete sensorManager;
	sensorManager = NULL;

	return ret;
}